package model;



//hangyaleso a mapelementbol szarmaztatva
public class AntLion extends MapElement{
	protected boolean isAlive;
	//konstuktor
	public AntLion(int x, int y, String type, float range) {
		super(x, y, type, range);
		isAlive = true;
	}
	//alapkonstruktor
	public AntLion(){
		super();
		isAlive = true;
	}
	
	public AntLion(int id,int x,int y){
		super("antlion",id,x,y);
		isAlive = true;
	}
	//kirajzolas	
	public void draw(){}

	@Override
	//hangya utkozes vizsgalat
	public boolean collision(Ant a) {
		double distance = Math.sqrt((Math.pow(Math.abs(a.loc_x - this.loc_x), 2.0)) + (Math.pow(Math.abs(a.loc_y - this.loc_y), 2.0)));
		if (distance < range){
			a.killAnt();
			return true;
		}
		else return false;
	}
	public boolean getisAlive(){
		return isAlive;
	}
}
